package com.kfm.controller;

import com.kfm.model.UserInfo;
import com.kfm.service.UserInfoService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@RestController
public class UserInfoController {
    private UserInfoService service = new UserInfoService();

    @RequestMapping("/list")
    public List<UserInfo> list() {
        // ModelAndView mv = new ModelAndView();
        // List<UserInfo> list = service.findAll();
        // mv.addObject("all", list);
        // mv.setViewName("list");
        // return mv;
        return service.findAll();
    }

}
